home *** CD-ROM | disk | FTP | other *** search
- FILES - A Small File and Directory Manipulation Utility for DOS
-
- by Philip J. Erdelsky
- PLAIN VANILLA CORPORATION
- CompuServe 75746,3411
- InterNet 75746.3411@compuserve.com
-
- January 15, 1993
-
- PUBLIC DOMAIN -- NO RESTRICTIONS ON USE
-
- 1. Introduction
- ---------------
-
- The FILES utility is a small file and directory manipulation utility for DOS
- (versions 2.00 and later). It was written mainly to test RDCF 2.0 and
- duplicates a number of DOS internal and external commands, but it adds enough
- functions to DOS to be useful in itself.
-
- Here is what you can do with the FILES utility that you cannot do with DOS
- commands alone:
-
- (1) You can see hidden, system and deleted files and volume labels in
- directory listings. (You can see hidden and system files, but not
- deleted files, with DOS 5.0.)
-
- (2) You can change the date and time of a file, directory or volume
- label.
-
- (3) You can sort a directory.
-
- (4) You can restore a deleted file, if the file is not fragmented and has
- not been overwritten.
-
- (5) You can move a file or subdirectory from one directory to another
- without copying its data.
-
- (6) You can recover remnants of deleted files in the empty data clusters.
-
- (7) You can wipe out remnants of deleted files in empty data clusters so
- they cannot be recovered later.
-
- Some of these things can't be done even by special programs that issue DOS
- calls. The FILES utility can do them only because it goes around the DOS file
- system and accesses the disk on a sector-by-sector basis.
-
- The FILES utility works with diskettes and hard disk partitions smaller than
- 32 megabytes. It will not work with larger partitions, such as those used by
- DOS 4.00 and later versions of DOS, and it will not work with LAN drives.
-
- IMPORTANT: The FILES utility does not recognize any current drive or
- subdirectory. You will have to type an explicit drive specification for every
- file, and, for a file not in the root directory, a complete directory path.
- Contrary to the usual DOS practice, the directory path must NOT begin with a
- backslash. Sorry about that.
-
- The FILES utility and its source code are in the public domain, but the RDCF
- 2.0 file package is copyrighted. If you want to make changes to the FILES
- utility for your own use, you will have to obtain RDCF 2.0. You may make
- copies for your own use, but commercial use of RDCF 2.0 requires permission.
- You will also need a third package called the Reentrant Cache System 1.1, but
- that is also in the public domain.
-
- The current version of the FILES utility treats drives other than A: and B: as
- read-only. You can change that if you know what you're doing.
-
-
- 2. Bringing up the FILES Utility
- --------------------------------
-
- The FILES utility resides in the file FILES.EXE. Copy this file from the
- distribution diskette, or download it from a BBS.
-
- Make sure the file FILES.EXE is in the current directory, or in a directory
- made accessible by the DOS PATH command, and type
-
- FILES
-
- in response to the DOS prompt.
-
- The FILES utility will then display its prompt:
-
- FILES>
-
- Enter FILES commands just as you would enter DOS commands, using the backspace
- key to make corrections. If you have installed a DOS command line editor, it
- will probably work with the FILES utility because the utility uses the same
- DOS system call (number 10) as the DOS command line interpreter.
-
- It is presumed that you are reasonably conversant with DOS commands.
-
- You can execute FILES commands from a file by simply redirecting the file to
- the FILES utility as its standard input; e.g.,
-
- FILES <file
-
- Be sure to end the file with an EXIT command, or you'll have to reboot to
- regain control of your computer!
-
- If you use this technique, remember that the command file is being read by DOS,
- not by the FILES utility. Do not include FILES commands that write to the
- drive on which the command file resides. The FILES utility and DOS will not
- cooperate.
-
- If you can't remember the FILES commands, just type HELP in response to the
- FILES> prompt. Here is what you'll see:
-
- COPY source destination
- DATE file month-day-year hour:min:sec
- DEL file
- DIR directory
- DIRSORT directory
- EXIT
- HELP
- MD directory
- MCOPY files directory
- MOVE source destination
- RECOVER file
- REN old new
- TYPE file
- UNDEL file
- VOLUME name
- WIPE drive
-
-
- 2.1. COPY - Copy a File
- -----------------------
-
- The FILES command
-
- COPY source destination
-
- copies one file to another, just the way DOS does. However, you cannot copy
- multiple files, and you must supply complete file specifications. For
- example, to copy the file FOO.C from drive A: to the subdirectory \PROG on
- drive B:, you must type
-
- COPY A:FOO.C B:PROG\FOO.C
-
- For file copying, you'll probably prefer to use DOS.
-
-
- 2.2. DATE - Change the Date and Time of a File, Directory or Volume
- -------------------------------------------------------------------
-
- The FILES command
-
- DATE file month-day-year hour:min:sec
-
- changes the date and time of a file or subdirectory. The date and time are
- expressed in numerical form, and a 24-hour clock is used. To change the date
- and time of the file A:FOO.C to September 15, 1992, 3:15 PM, type
-
- DATE A:FOO.C 9-15-92 15:13:00
-
- If the file specifications represent a subdirectory, its date and time will be
- changed. That's something DOS won't do!
-
- If you use a drive specification only, the date and time of the volume label
- will be changed.
-
-
- 2.3 DEL - Delete a File, Directory or Volume
- --------------------------------------------
-
- The FILES command
-
- DEL file
-
- deletes the specified file. If the file specifications represent a
- subdirectory, it deletes the subdirectory (provided it is empty). Hence it
- does the work of both the DOS DEL and RD commands.
-
- If you use a drive specification only, the volume label will be deleted.
-
-
- 2.4. DIR - Directory Listing
- ----------------------------
-
- The FILES command
-
- DIR directory
-
- lists the contents of the specified directory, including volume labels, hidden
- and system files, subdirectories and deleted volume labels, files and
- subdirectories.
-
- If you use a drive specification only, contents of the root directory will be
- displayed.
-
- To pause the display, type Ctrl-S; to abort the display, type Ctrl-C.
-
-
- 2.5. DIRSORT - Sort a Directory
- -------------------------------
-
- The FILES command
-
- DIRSORT directory mode
-
- sorts the entries in the specified directory in the specified manner.
-
- The mode may be any ONE of the following:
-
- mode manner of sort
- ---- -----------------------------------------------------------------
- E sort by extension, then among files that have the same extension,
- sort by name
- D sort by date and time (earlier files first)
- N sort by name, then among files that have the same name, sort by
- extension
- S sort by size (smallest files first)
-
- The letter R may be appended to any of these modes to sort in the opposite
- order. For example, SR sorts the files by size, but it puts the largest files
- first.
-
- If you omit the mode, N is presumed.
-
- Actually, before the FILES utility sorts the directory entries, it first
- divides them into five groups and arranges them in the following order:
-
- (1) The two system files at the beginning of the root directory and the
- two special files "." and ".." at the beginning of a subdirectory are
- always left where they are.
-
- (2) The volume label, if any, is put next.
-
- (3) The subdirectory entries, if any, are sorted and put next.
-
- (4) The file entries are sorted and put next.
-
- (5) The entries for deleted files, volume labels and subdirectories, if
- any, are sorted and put last.
-
- Within each category, if two entries are identical according to the sorting
- criterion, their relative position is left unchanged.
-
- If you supply only a drive specification, the root directory will be sorted.
-
- The sorting algorithm is fairly unsophisticated, so sorting a long
- subdirectory may take quite some time. Please be patient.
-
-
- 2.6. EXIT - Return to DOS
- -------------------------
-
- The following FILES command returns control to DOS:
-
- EXIT
-
- If you redirect commands from a file to the FILES utility, be sure to end it
- with an EXIT command. Otherwise, the utility will hang up at the end of the
- file and you'll have to reboot to regain control of your computer.
-
-
- 2.7. HELP - Display a List of FILES Commands
- --------------------------------------------
-
- The following FILES command displays a list of FILES commands:
-
- HELP
-
-
- 2.8. MD - Make Directory
- ------------------------
-
- The FILES command
-
- MD directory
-
- creates the specified directory, just like the corresponding DOS command.
-
-
- 2.9. MOVE - Move a File or Subdirectory
- ---------------------------------------
-
- The FILES command
-
- MOVE source destination
-
- moves the source file to the destination file. Since it is not possible to
- move a file from one drive to another with this command, the destination file
- specifications must NOT contain a drive specification.
-
- For example, to move the file FOO.C from the root directory to the
- subdirectory PROG on drive B:, type
-
- MOVE B:FOO.C PROG\FOO.C
-
- The effect of this command is the same (in almost all cases) as the following
- two commands, but it is much more efficient because the data is not copied:
-
- COPY source destination
- DEL source
-
- (Slight differences occur when the disk is nearly full. The COPY-DEL sequence
- may fail for lack of disk space but MOVE will succeed.)
-
- You can rename a file as you move it merely by giving it a different name in
- the new directory. You could also use this command to rename a file without
- moving it, but it would be less efficient than the REN command and might fail
- for lack of directory space when then REN command wouldn't.
-
- If the source file specifications represent a subdirectory, it and all of the
- files and subdirectories in it will be moved. That's something that DOS won't
- do, and it can be quite handy. However, be sure not to corrupt the file
- system by moving a directory into itself or one of its own subdirectories.
- The FILES utility won't protect you from such folly.
-
-
- 2.10. RECOVER - Recover Deleted File Remnants in Empty Clusters
- ---------------------------------------------------------------
-
- The FILES command
-
- RECOVER file
-
- creates the specified file as a new file, gathers all the empty data clusters
- on drive and links them together as the new file contents. The new file will
- then contain all the data from deleted files and subdirectories that has not
- been reused by other files or subdirectories.
-
- If you want to use a text editor or word processor on the new file to find the
- desired information, you will probably have to copy the file to another disk or
- a hard drive that has room for the temporary and backup files that most text
- editors and word processors require. For obvious reasons, there won't be any
- room on the same disk!
-
- The new file must not be the same as an existing file. It may reside in a
- subdirectory, but the FILES utility will not lengthen the subdirectory to
- accommodate it, since that would destroy some of the information that you want
- to recover.
-
-
- 2.11. REN - Rename a File
- -------------------------
-
- The FILES command
-
- REN old new
-
- renames a file, without moving it to another directory or drive. The new file
- specifications may include a name and extension only. For example, the
- following command changes the file A:PROG\FOO.C into A:PROG\BAH.C:
-
- REN A:PROG\FOO.C BAH.C
-
-
- 2.12. TYPE - Display a File
- ---------------------------
-
- The FILES command
-
- TYPE file
-
- displays the contents of a file.
-
- To pause the display, type Ctrl-S; to abort the display, type Ctrl-C.
-
-
- 2.13. UNDEL - Undelete a File
- -----------------------------
-
- The FILES command
-
- UNDEL file
-
- attempts to restore a deleted file. The FILES utility will tell you whether
- the file is unrecoverable, partly recoverable or fully recoverable.
-
- Even if the file appears to have been fully recovered, there is no guarantee
- that the original file contents have been restored. For example, if another
- file has been written over the original contents and then deleted, there is no
- way that the FILES utility can determine that the original contents have been
- changed. Even if this has not happened, the FILES utility may not know
- exactly where to look for the contents. It just does the best it can.
-
-
- 2.14. VOLUME - Add or Change Volume Label
- -----------------------------------------
-
- The FILES command
-
- VOLUME drive:
-
- displays the volume label for the specified drive, or tells you that the drive
- has no volume label.
-
- The FILES command
-
- VOLUME drive: label
-
- changes the volume label on the specified drive to the specified text, or adds
- a new volume label with the specified text.
-
- DOS file and directory names and extensions are case-insensitive, but the same
- is NOT true of volume labels. They can contain small letters, spaces and
- some special characters. Command syntax will prevent you from embedding a
- space in a volume label, even though DOS might permit it on a disk.
-
-
- 2.15. WIPE - Wipe Empty Data Clusters
- -------------------------------------
-
- The FILES command
-
- WIPE d:
-
- writes nonsense into all unused data clusters on the specified drive, so any
- remnants of deleted files on the drive cannot be recovered by either the UNDEL
- or the RECOVER command.
-
- CAUTION: If the drive uses data clusters consisting of more than one sector,
- there may be some remnants of deleted files in the last clusters of files that
- are not long enough to occupy all sectors of their last clusters. These
- little snippets of information cannot be recovered by the FILES utility, but
- they can be recovered by more sophisticated utilities.
-
-
-